package oop.controller.action.teststruct;

import oop.controller.action.DefaultAction;
import oop.db.dao.TestStructureDAO;

public class DeleteAction extends DefaultAction {

	@Override
	public void performImpl() throws Exception {
		try {
			int teststructureId = Integer.parseInt(request
					.getParameter("teststructureId"));
			TestStructureDAO.drop(teststructureId);
			setNextAction("teststruct.view");

		} catch (NumberFormatException ex) {
			request.setAttribute("message", "ID khong hop le");
			setNextAction("error");
		}
	}
}
